package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.AppDynamicMsg;
import com.ruoyi.system.mapper.AppDynamicMsgMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BaseUserPrivilegesMapper;
import com.ruoyi.system.domain.BaseUserPrivileges;
import com.ruoyi.system.service.IBaseUserPrivilegesService;

/**
 * 特权用户Service业务层处理
 *
 * @author ruoyi
 * @date 2023-03-09
 */
@Service
public class BaseUserPrivilegesServiceImpl extends ServiceImpl<BaseUserPrivilegesMapper, BaseUserPrivileges> implements IBaseUserPrivilegesService {
    @Autowired
    private BaseUserPrivilegesMapper baseUserPrivilegesMapper;

    /**
     * 查询特权用户
     *
     * @param id 特权用户主键
     * @return 特权用户
     */
    @Override
    public BaseUserPrivileges selectBaseUserPrivilegesById(Long id) {
        return baseUserPrivilegesMapper.selectBaseUserPrivilegesById(id);
    }

    /**
     * 查询特权用户列表
     *
     * @param baseUserPrivileges 特权用户
     * @return 特权用户
     */
    @Override
    public List<BaseUserPrivileges> selectBaseUserPrivilegesList(BaseUserPrivileges baseUserPrivileges) {
        return baseUserPrivilegesMapper.selectBaseUserPrivilegesList(baseUserPrivileges);
    }

    /**
     * 新增特权用户
     *
     * @param baseUserPrivileges 特权用户
     * @return 结果
     */
    @Override
    public int insertBaseUserPrivileges(BaseUserPrivileges baseUserPrivileges) {
        baseUserPrivileges.setCreateTime(DateUtils.getNowDate());
        return baseUserPrivilegesMapper.insertBaseUserPrivileges(baseUserPrivileges);
    }

    /**
     * 修改特权用户
     *
     * @param baseUserPrivileges 特权用户
     * @return 结果
     */
    @Override
    public int updateBaseUserPrivileges(BaseUserPrivileges baseUserPrivileges) {
        baseUserPrivileges.setUpdateTime(DateUtils.getNowDate());
        return baseUserPrivilegesMapper.updateBaseUserPrivileges(baseUserPrivileges);
    }

    /**
     * 批量删除特权用户
     *
     * @param ids 需要删除的特权用户主键
     * @return 结果
     */
    @Override
    public int deleteBaseUserPrivilegesByIds(Long[] ids) {
        return baseUserPrivilegesMapper.deleteBaseUserPrivilegesByIds(ids);
    }

    /**
     * 删除特权用户信息
     *
     * @param id 特权用户主键
     * @return 结果
     */
    @Override
    public int deleteBaseUserPrivilegesById(Long id) {
        return baseUserPrivilegesMapper.deleteBaseUserPrivilegesById(id);
    }
}
